﻿using System.Web;

namespace Bussines.Utils
{
    public class MessageBox
    {
        private MessageBox()
        {
        }

        public static void Show(string sMessage)
        {
            HttpContext.Current.Response.Write("<script language='javascript'>window.alert('" + sMessage +
                                               "');</script>");
        }

        public static void Show(string sMessage, string url)
        {
            HttpContext.Current.Response.Write("<script language='javascript'>window.alert('" + sMessage +
                                               "');window.location.href='" + url + "';</script>");
        }

        public static void ShowConfirmDialog(string message)
        {
            HttpContext.Current.Response.Write("<script language='javascript'>return window.confirm('" + message +
                                               "');</script>");
        }

        public static void ShowConfirmDialog(string message, string url)
        {
            HttpContext.Current.Response.Write("<script language='javascript'>window.confirm('" + message +
                                               "');window.location.href='" + url + "';</script>");
        }

        public static void redirectJS(string url)
        {
            HttpContext.Current.Response.Write("<script language='javascript'>window.location.href='" + url +
                                               "';</script>");
        }
    }
}